package com.beerandjesus.sportofkings.handicapper.factory.profile.brisnet.singlefile;

import com.beerandjesus.sportofkings.handicapper.factory.profile.ProfileFactory;
import com.beerandjesus.sportofkings.handicapper.factory.profile.AnalysisProfileResolver;
import com.beerandjesus.sportofkings.handicapper.model.*;
import com.beerandjesus.sportofkings.handicapper.model.brisnet.singlefile.Race;
import com.beerandjesus.sportofkings.handicapper.model.brisnet.singlefile.Horse;
import com.beerandjesus.sportofkings.handicapper.model.brisnet.singlefile.PastPerformance;
import com.beerandjesus.sportofkings.handicapper.model.brisnet.singlefile.HorseRace;
import com.beerandjesus.sportofkings.handicapper.dao.Database;

import java.util.List;
import java.util.ArrayList;

import org.apache.commons.lang.StringUtils;

/**
 * Date: Jun 8, 2012
 * Time: 2:21:28 PM
 */
public class ProfileFactoryImpl implements ProfileFactory {

    private List<AnalysisProfileResolver> resolvers;

    public List<AnalysisProfile> getProfiles(HorseRace horseRace, Horse horse) {
        List<AnalysisProfile> profiles = new ArrayList<AnalysisProfile>();
        for (AnalysisProfileResolver resolver : resolvers) {
            AnalysisProfile p = resolver.resolve(horseRace, horse);
            if (p != null) {
                profiles.add(p);
            }
        }
        return profiles;
    }

    public Database getDatabase() {
        return null;
    }


    public List<AnalysisProfileResolver> getResolvers() {
        return resolvers;
    }

    public void setResolvers(List<AnalysisProfileResolver> resolvers) {
        this.resolvers = resolvers;
    }
}
